package cn.iocoder.yudao.module.biz.dal.mysql.expand.targets;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.biz.controller.admin.expand.targets.vo.ExpandTargetPageReqVO;
import cn.iocoder.yudao.module.biz.dal.dataobject.expand.targets.ExpandTargetDO;
import cn.iocoder.yudao.module.biz.dal.dataobject.expand.targets.ExpandTargetViewDO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;


/**
 * 拓展目标 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface ExpandTargetViewMapper extends BaseMapperX<ExpandTargetViewDO> {

    default PageResult<ExpandTargetViewDO> selectAllExpandTargetPage(ExpandTargetPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ExpandTargetViewDO>()
                .likeIfPresent(ExpandTargetViewDO::getName, reqVO.getName())
                .eqIfPresent(ExpandTargetViewDO::getType, reqVO.getType())
                .likeIfPresent(ExpandTargetViewDO::getDirectorName, reqVO.getDirectorName())
                .eqIfPresent(ExpandTargetViewDO::getContactNumber, reqVO.getContactNumber())
                .eqIfPresent(ExpandTargetViewDO::getAddress, reqVO.getAddress())
                .eqIfPresent(ExpandTargetViewDO::getOwnerUserId, reqVO.getOwnerUserId()));
    }

    default List<ExpandTargetViewDO> selectAllExpandTarget(ExpandTargetPageReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<ExpandTargetViewDO>()
                .likeIfPresent(ExpandTargetViewDO::getName, reqVO.getName())
                .eqIfPresent(ExpandTargetViewDO::getType, reqVO.getType())
                .likeIfPresent(ExpandTargetViewDO::getDirectorName, reqVO.getDirectorName())
                .eqIfPresent(ExpandTargetViewDO::getContactNumber, reqVO.getContactNumber())
                .eqIfPresent(ExpandTargetViewDO::getAddress, reqVO.getAddress())
                .eqIfPresent(ExpandTargetViewDO::getOwnerUserId, reqVO.getOwnerUserId()));
    }

}